#!/bin/sh
#sh commit-msg.sh $1 
echo user is $1
SERVER_PORT="29418"
###gerrit服务器ip地址，根据具体情况更改
SERVER_IP="192.168.8.250"
mkdir -p ~/.git_template/hooks
scp -p -P "$SERVER_PORT" $1@"$SERVER_IP":hooks/commit-msg ~/.git_template/hooks
chmod u+x ~/.git_template/hooks/commit-msg
git config --global init.templatedir ~/.git_template
